/**
 *  项目JS主入口
 以依赖Layui的layer和form模块为例
 * Created by Wangwei on 2017/1/4.
 */
layui.define([], function (exports) {
    var profile='test';      //运行环境 默认:开发环境

    var setting = {
        server: {
            protocol: 'http://',
            //dev
            dev : {
                ip: 'localhost',
                port: '8080',
                path: '/rest',
                testPath: '/Admin/admin-ui'
            },

            //test
            test: {
                ip: '139.224.11.152',
                port: '8080',
                path: '/rest',
                testPath: '/admin'
            },

            //prod
            prod: {
                ip: 'data.haochedai.cn',
                port: '80',
                path: '/rest',
                testPath: ''
            }
        },

        getLocalUri: function () {
            return this.server[profile].testPath;
        },

       /* getOldSystemUri: function () {
         return this.server[profile].oldsystem;
         },
         */
        getUri: function () {
            return this.server.protocol + this.server[profile].ip + ':' + this.server[profile].port
                + this.server[profile].path;
        },
        config: {
            index: {
                login: '/index/login',
                logout: '/index/logout',
                captcha: '/index/captcha'
            },

            user: {
                list: '/user',
                info: '/user/info',
                create: '/user/create',
                update: '/user/update',
                delete: '/user/delete',
                editpass: '/user/editpass'
            },
            role: {
                list: '/role/list',
                create: '/role/create',
                update: '/role/update',
                delete: '/role/delete'
            },
            resource: {
                permission: '/resource/permission',
                menus: {
                    list: '/resource/menus',
                    create: '/resource/create',
                    update: '/resource/update',
                    del: '/resource/delete'
                },
                list: '/resource/list'
            },
            demo: {
                upload:'/index/upload'
            }
        }
    };
    exports('config', setting); //注意，这里是模块输出的核心，模块名必须和use时的模块名一致
});